<div class="margin_top15 margin_bottom10">
	<span class="bold">已发布的系统消息</span>
	<a href="javascript:void(0)" class="orange_button" style="float:right;#margin-top:-26px;">清除</a>
	<div class="clear"></div>
</div>
<form id="post-form" method="post">
<table class="a_table">
	<tr>
		<th><input type="checkbox" id="check-all"/>全选</th>
		<th>收信人</th>
		<th>标题</th>
		<th>时间</th>
	</tr>
	<?php if (!empty($logs)) {?>
	<?php foreach($logs as $log) { ?>
	<?php
	$params = json_decode($log['params']);
	if(empty($params->message_id)) continue;
	?>
	<tr>
		<td><input type="checkbox" name="ids[]" value="<?php echo $log['id'];?>"/></td>
		<td><?php echo !empty($params->msg_to) ? $params->msg_to : '';?></td>
		<td><?php echo $params->subject;?></td>
		<td><?php echo $log['created'];?></td>
	</tr>
	<?php } ?>
	<?php }?>
</table>
<input type="hidden" name="type" value="<?php echo empty($type) ? "all" : $type;?>"></input>
</form>
<script type="text/javascript">
$(document).ready(function(){
	$("#check-all").click(function() {
		$("input[name='ids[]']").each(function(){
			if($(this).attr("checked") == 'checked') {
				$(this).attr("checked", false);
			} else {
				$(this).attr("checked", true);
			}
		});
	});
	$(".orange_button").click(function() {
		$("#post-form").submit();
	});
});
</script>